using System;
using System.Xml.XPath;

namespace Weather.com.Client.WeatherConditions.Common
{
    internal class PromoLinkFactory
    {
        internal PromoLink Create(XPathNodeIterator navigator)
        {
            PromoLink promoLink = new PromoLink();
            XPathNavigator current = navigator.Current;
            promoLink.Position = int.Parse(current.GetAttribute("pos", string.Empty));
            promoLink.Url = new Uri(current.SelectSingleNode("l").Value);
            promoLink.Title = current.SelectSingleNode("t").Value;
            return promoLink;
        }
    }
}